﻿using System.Collections;

namespace RAP.Web.Libary.Common.Model.Session
{
  /// <summary>
  /// 
  /// </summary>
  public class WebUserSession : UserSessionBase, IWebUserSession
  {
    /// <summary>
    /// 菜单权限
    /// </summary>
    public IDictionary Menus { get; set; }

    /// <summary>
    /// 数据权限
    /// </summary>
    public IDictionary DataPowers { get; set; }

    /// <summary>
    /// 判断当前用户是否有指定编码的菜单权限
    /// </summary>
    /// <param name="code"></param>
    /// <returns></returns>
    public bool HasMenuPower(string code)
    {
      return this.Menus != null && this.Menus.Contains(code);
    }

    /// <summary>
    /// 判断当前用户是否有指定编码的数据权限
    /// </summary>
    /// <param name="code"></param>
    /// <returns></returns>
    public bool HasDataPower(string code)
    {
      return this.DataPowers != null && this.DataPowers.Contains(code);
    }


  }
}
